<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var reg = /(http):\/\/(.*?)>(.*?)</g;
    var s = '<a href="http://www.baidu.com">百度</a><a href="http://www.baidu.com">百度</a><a href="http://www.baidu.com">百度</a><a href="http://www.baidu.com">百度</a><a href="http://www.baidu.com">百度</a>';//021 23442344
    var r = s.match(reg);
    console.log(r);

       var r2 = s.replace(reg,function($0,$1,$2,$3){//根据auguments推出的，参数的个数与正则中括号的个数成一定关系
            console.log("aa");
//           console.log(arguments); https://www.baidu.com target="_blank">百度<
           return $1+'s://'+$2+' target="_blank"><b>'+$3+'</b><';
//           return
       });
    console.log(r2);
</script>
</body>
</html>